Enhanced embedded logic analyzer

ABSTRACT

Embedding a logic analyzer in a programmable logic device allows signals to be captured both before and after a trigger condition (breakpoint). A logic analyzer embedded within a PLD captures and stores logic signals. It unloads these signals for viewing on a computer. Using an electronic design automation (EDA) software tool running on a computer system, an engineer specifies signals of the PLD to be monitored, a breakpoint, total number of samples to be stored, number of samples to be captured after the breakpoint occurs, and a system clock signal. The EDA tool automatically inserts the logic analyzer into the electronic design of the PLD which is compiled and downloaded to configure the PLD. Using an interface connected between the PLD and the computer, the EDA tool commands the embedded logic analyzer to run. Signals are stored continuously while running in a ring buffer RAM memory. Once the breakpoint occurs, more samples are captured if desired, in addition to those signals captured before breakpoint. The EDA tool directs the logic analyzer to unload the data from its capture buffer for display on a computer. The breakpoint and sample number can be changed without recompiling. A JTAG port controls the logic analyzer. Inputs and outputs of the logic analyzer are routed to unbonded JTAG-enabled I/O cells. Alternatively, a user-implemented test data register provides a JTAG-like chain of logic elements through which control and output information is shifted. Stimulus cells provide control information to the logic analyzer, and sense cells retrieve data from the logic analyzer.

This application claims priority of U.S. provisional patent applicationNo. 60/065,602, filed Nov. 18, 1997, entitled “Enhanced Embedded LogicAnalyzer” which is incorporated by reference. This application is acontinuation-in-part of U.S. patent application No. 08/958,435, filedOct. 27, 1997, now U.S. Pat. No. 6,182,247 entitled “Embedded LogicAnalyzer For A Programmable Logic Device” which is incorporated byreference.

This application is related to U.S. patent application No. 09/186,608filed on the same date herewith, entitled “Enhanced Embedded LogicAnalyzer,” which is hereby incorporated by reference.

FIELD OF THE INVENTION

The present invention relates generally to analysis of a hardware devicein connection with a computer system. More specifically, the presentinvention relates to a logic analyzer that is automatically embeddedwithin a hardware device for purposes of debugging.

BACKGROUND OF THE INVENTION

In the field of electronics, various electronic design automation (EDA)tools are useful for automating the process by which integratedcircuits, multi-chip modules, boards, etc., are designed andmanufactured. In particular, electronic design automation tools areuseful in the design of standard integrated circuits, custom integratedcircuits (e.g., ASICs), and in the design of custom configurations forprogrammable integrated circuits. Integrated circuits that may beprogrammable by a customer to produce a custom design for that customerinclude programmable logic devices (PLDs). Programmable logic devicesrefer to any integrated circuit that may be programmed to perform adesired function and include programmable logic arrays (PLAs),programmable array logic (PAL), field programmable gate arrays (FPGA),complex programmable logic devices (CPLDs), and a wide variety of otherlogic and memory devices that may be programmed. Often, such PLDs aredesigned and programmed by a design engineer using an electronic designautomation tool that takes the form of a software package.

In the course of generating a design for a PLD, programming the PLD andchecking its functionality on the circuit board or in the system forwhich it is intended, it is important to be able to debug the PLDbecause a design is not always perfect the first time. Before a PLD isactually programmed with an electronic design, a simulation and/ortiming analysis may be used to debug the electronic design. However,once the PLD has been programmed and is operating within a workingsystem, it is also important to be able to debug the PLD in thisreal-world environment.

And although a simulation may be used to debug many aspects of a PLD, itis nearly impossible to generate a simulation that will accuratelyexercise all of the features of the PLD on an actual circuit boardoperating in a complex system. For example, a simulation may not be ableto provide timing characteristics that are similar to those that willactually be experienced by the PLD in a running system; e.g., simulationtiming signals may be closer or farther apart than what a PLD willactually experience in a real system.

In addition to the difficulties in generating a comprehensivesimulation, other circuit board variables such as temperature changes,capacitance, noise, and other factors may cause intermittent failures ina PLD that are only evident when the PLD is operating within a workingsystem. Still further, it can be difficult to generate sufficientlyvaried test vectors to stress the PLD design to the point where mostbugs are likely to be observed. For example, a PLD malfunction canresult when the PLD is presented with stimuli that the designer did notexpect, and therefore did not take into account during the design andsimulation of the PLD. Such malfunctions are difficult to anticipate andmust be debugged in the context of the complete system. Thus, simulationof an electronic design is useful, but usually cannot debug a PLDcompletely.

One approach to debugging a hardware device within a working system isto use a separate piece of hardware equipment called a logic analyzer toanalyze signals present on the pins of a hardware device. (For example,the HP1670A Series Logic Analyzer from Hewlett-Packard Company.)Typically, a number of probe wires are connected manually from the logicanalyzer to pins of interest on the hardware device in order to monitorsignals on those pins. The logic analyzer captures and stores thesesignals. However, the use of an external logic analyzer to monitor pinsof a hardware device has certain limitations when it comes to debuggingsuch a device. For example, such an external logic analyzer can onlyconnect to and monitor the external pins of the hardware device. Thus,there is no way to connect to and monitor signals that are internal tothe hardware device. Unfortunately, when programming a hardware devicesuch as a PLD, it would be useful to be able to monitor some of theseinternal signals in order to debug the PLD.

Although some custom hardware devices may come ready made with someinternal debugging hardware, this debugging hardware is typicallyhardwired to route specific internal signals and cannot be readilychanged by an engineer who wishes to look at other signals. Also, withsuch built-in debugging it is not possible to choose any signal tomonitor that the engineer desires, nor can triggering signals andtriggering conditions be changed by the engineer. Because a PLD by itsvery nature is a programmable device that an engineer is attempting toprogram to perform a particular function, it is important to theengineer to be able to customize monitored signals, trigger signals, andtrigger conditions in order to efficiently debug any particular device.Further, creating an electronic design for a PLD is an iterative processthat requires creative debugging by an engineer who may wish to viewalmost any internal signal, and who may change his mind fairlyfrequently in the course of debugging a PLD within a system. Knownexternal and internal logic analyzers do not provide this flexibility.

A further drawback to using an external logic analyzer or hardwiredpredetermined debugging hardware inside of a custom chip is that oftenthe number of internal signals that an engineer desires to monitor aregreater than the number of available pins on the device. For example, ifthere are sixteen internal signals that an engineer wishes to monitor ona device, he is unable to do this using an external logic analyzer ifthe device has only four pins available for debugging.

In some cases, it is possible for an engineer to employ a conventionallogic analyzer to study an internal signal of a PLD. This may beaccomplished by, for example, an engineer modifying his design so that anormally internal signal is routed temporarily to an output pin of thePLD. The design is then recompiled. The engineer then attaches a probeto this output pin in order to monitor the “internal” signal.Unfortunately, the engineer must recompile his design and reprogram thePLD in order to view this internal signal. Also, when debugging iscomplete, the engineer must again rewrite the design to remove theinternal signal from the output pin, recompile the design and finallyreprogram the PLD again. This can be a tedious process.

Even if an engineer is successful in routing an internal signal to anoutput pin of a PLD, with certain integrated circuit packages it may beextremely difficult to attach an external logic analyzer. For anintegrated circuit in a dual in-line package it may be relativelystraightforward to attach the probes of a logic analyzer to the top ofthe package as long as the package is in an easily accessible locationon a circuit board. However, if the package is in a difficult to reachlocation because of device crowding, it may be difficult to physicallyattach logic analyzer probes to particular output pins of interest. Evenmore troublesome are integrated circuits with rows of miniature contactslocated on the top of the package (e.g., “flip chips”). It is difficultto attach logic analyzer probes to particular outputs of interest withthis type of package. Some integrated circuit are encased in a ball gridarray package with the contacts located on the bottom of the package upagainst the circuit board; for these packages, it may be nearlyimpossible to attach logic analyzer probes to these small contactslocated on the underside of the package. Thus, use of an external logicanalyzer has shortcomings even if an internal signal can be routed to apin of a device.

U.S. patent application No. 08/958,435 entitled “Embedded Logic AnalyzerFor A Programmable Logic Device” discloses an advantageous apparatus andtechniques that allow an embedded logic analyzer to flexibly analyzeinternal signals of interest in an electronic design, such as within aprogrammable logic device (PLD). Nevertheless, there is room forimprovement in the analysis of internal signals of a PLD for debuggingpurposes.

For example, some logic analyzers allow a user to specify a triggercondition and a set of trigger signals that must satisfy that triggercondition before the logic analyzer is triggered into the capture ofdata. Such logic analyzers are useful when it is desirable to captureand analyze signal data that occurs immediately after a particulartrigger condition (such as a failure of the device). It is oftendesirable, however, to capture signals for later analysis that occurbefore the trigger condition. For the most part, these logic analyzersthat begin data capture based upon satisfaction of a trigger conditionare unable to provide captured signals before the trigger conditionbecause the logic analyzer is only designed to begin capture upon anerror, failure or other trigger condition. Because these errors and/orfailures are unanticipated, these type of logic analyzers are unable toanticipate the trigger condition, and hence, are unable to begincapturing data before the trigger condition occurs.

In some debugging situations, it can be extremely advantageous tocapture signals that occur before the trigger conditions occurs. Forexample, when debugging a PCI bus interface, a situation may occur inwhich the interface enters an illegal state. Traditional logic analyzerswould be able to detect that illegal state and immediately begincapturing signal data for later analysis. It would be extremelydesirable, however, to begin capturing signal data before the businterface enters the illegal state in order to determine why the bus hasentered this illegal state. In another example, when an interruptoccurs, it can be extremely desirable to know the history of certainregisters before the interrupt occurs. In other words, once theinterrupt is received, data capture may begin, but the registers mayalready be in an incorrect state. It would be extremely desirable to beable to capture and analyze signal data before the interrupt occurs inorder to determine why certain registers are in an incorrect state whenthe interrupt occurs. Other situations in which it would be desirable tocapture signal data before a specific trigger condition are alsopossible.

Various prior art efforts present partial solutions, but each have theirdrawbacks. For example, external logic analyzers available from theHewlett-Packard Company allow capture of signal data before a triggercondition (or breakpoint) occurs. Unfortunately, these external logicanalyzers suffer from many of the disadvantages associated with externallogic analyzers discussed above. Actel Corporation of Sunnyvale, Calif.provides two probes within a programmable logic device that are able tomonitor two different signals, but these signals must be prespecified bythe user and may not be flexibly reassigned to other signals. Inaddition, the Actel probes provide constant monitoring of particularsignals, but do not allow capture of relevant signal data in relation toa specified breakpoint.

Therefore it would be desirable to have an apparatus and technique thatwould allow a logic analyzer embedded within a programmable logic deviceto flexibly capture internal signals both before and after a specifiedbreakpoint.

Furthermore, it would be desirable to have an apparatus and techniquethat would efficiently and flexibly control a logic analyzer embeddedwithin a programmable logic device. As explained below, although variousoptions are available for controlling such an embedded logic analyzer,none of the prior art techniques are optimal. By way of background, abrief explanation of the design and manufacturing phases of a PLD and acircuit board will be provided first.

As described earlier in this section, a design engineer designs a PLDand programs such a device using an electronic design automation tool.In the course of this design phase, the design engineer may performnumerous design-program-debug iterations before the design is completeand the PLD ready for mass manufacturing. The design engineer often usesa simulation and/or a timing analysis to assist in debugging theelectronic design of the PLD. It is also conceivable that a designengineer would use an embedded logic analyzer (such as disclosed in U.S.patent application No. 08/958,435) to troubleshoot the design. Once thedesign of the PLD is complete to the design engineer's satisfaction, thedesign is handed off to a product engineer for the manufacturing phase.

In the manufacturing phase, a product engineer designs a manufacturingflow for the mass production of an electronic circuit board or otherelectronic device that incorporates one or more PLDs. During themanufacturing phase, it will be necessary to test the board itself andmay also be necessary to retest the PLD. In the beginning of themanufacturing phase, any number and type of hardware components and anynumber of PLDs are soldered to a board. Once on the board, a PLD is mostoften programmed (or configured) using a JTAG port located on the PLD.It is also possible that a particular PLD be programmed by itself beforeplacement on a board using a special socket and a programming unit.

A full board test may then be performed to test the traces, solderconnections, and other physical interfaces between components on theboard. It should be pointed out that a board test may also be performedbefore any devices on the board are programmed or configured. It iscommon to use a JTAG port of a PLD or other device to test the tracesand solder connections of a board during this board test. Once physicalconnections are tested, a complete functional test of the board is thenformed to test the overall functionality of the board (i.e., to ensurethat particular inputs produce the outputs expected). At this point, ifa failure is detected it may be necessary to debug a particular PLDwhile on the board. For failures more difficult to track down, it mayeven be necessary to remove a PLD from the board to be debugged. Inthese circumstances, as previously explained, it is desirable to have anembedded logic analyzer within the PLD to facilitate debugging. Duringany debugging of the PLD using an embedded logic analyzer, it isnecessary in some fashion to control the embedded logic analyzer, i.e.,to provide it with commands and data and to receive captured data andstatus from it. Although various options are available, none arecurrently optimal.

For example, it may be possible to use existing input/output pins of adevice to provide a control interface. Unfortunately, a particulardesign may not have enough extra input/output pins available throughwhich an interface can be provided to control an embedded logicanalyzer. It can be undesirable to require that a customer purchasing aPLD not use a certain number of input/output pins simply because the PLDmay not have been designed correctly and might have to be debugged atsome point.

Intel Corporation of Santa Clara, Calif. uses a JTAG port to controlaccess to specified debug registers for help in debugging a centralprocessing unit (CPU). Because a CPU is a known design, it is knownbeforehand exactly how many debug registers will be needed and controlis simpler. With a PLD, however, each user-implemented design will becustom; it is unknown ahead of time what that design will be and howmany debug registers might be needed. Different designs will requiredifferent debug registers. Thus the straightforward technique used byIntel with a known design of a CPU would not be appropriate with a PLD.

Therefore, an apparatus and technique are further desirable that wouldprovide simple, efficient and flexible control of an embedded logicanalyzer. It would further be desirable for such a control apparatus andtechnique to allow testing of a PLD on a circuit board in a real-worldenvironment.

SUMMARY OF THE INVENTION

To achieve the foregoing, and in accordance with the purpose of thepresent invention, a technique for embedding a logic analyzer in aprogrammable logic device is disclosed that allows capture of specifiedsignal data both before and after a specified breakpoint. Also disclosedare techniques for controlling an embedded logic analyzer using a JTAGport.

The present invention provides both an apparatus and a technique bywhich a logic analyzer circuit is automatically embedded within a PLD,by which it captures and stores logic signals both before and after abreakpoint, and by which it unloads these signals through an interfaceto a computer. In a preferred embodiment, analysis of the signals isperformed on the computer, with the “on-chip” logic analyzer circuitserving only to acquire the signals. The invention works especially wellwith a PLD because, by its very nature, a PLD is able to be programmedwith a design, the design may be changed, and the PLD programmed againand again. Thus, the logic analyzer circuit may be embedded in testdesigns or iterations in the process of designing a final PLD. Uponsuccessful debugging of the PLD design, the PLD chip can be reprogrammedwithout the logic analyzer circuit, or the circuit can be left on thechip.

In one embodiment of the invention, using an electronic designautomation (EDA) software tool running on a computer system, an engineerspecifies signals of the PLD to be monitored, specifies the number ofsamples to be captured, specifies a system clock signal, and specifiesnot only a breakpoint, but also the number of samples needed prior tothe breakpoint. (Alternatively, total samples could be specified and/orsamples needed after a breakpoint.) The EDA tool then automaticallyinserts the logic analyzer circuit into the electronic design of the PLDwhich is compiled and downloaded to configure the PLD. Using aninterface connected between the PLD and the computer, the EDA toolcommunicates with the embedded logic analyzer in order to instruct thelogic analyzer to run and to begin capturing data. Once a breakpointoccurs, the logic analyzer determines if more samples need to becaptured after the breakpoint. The EDA tool then directs the logicanalyzer to unload the data from sample memory and then displays thedata on the computer. The logic analyzer circuit may then run again tocapture another sequence of sample values.

In one specific embodiment of the invention, the logic analyzer capturesdata from specified signal lines continuously in a ring buffer, orsimilar memory structure that overwrites earlier stored data when full.In this fashion, relevant data is stored continuously before abreakpoint occurs, thus, the stored data may be viewed later by a userwho wishes to view signals occurring before the breakpoint. Once thebreakpoint occurs, a counter keeps track of how many additional samplesof data (if any) need be collected.

Often, a JTAG port is used either to program a PLD or to assist withtesting a circuit board on which PLDs are located. Advantageously, it isrealized that a JTAG port has traditionally been unused during thedesign and debugging of a particular PLD. Thus, it is further realizedthat a JTAG port on a PLD is under utilized and may be used duringdebugging of a PLD as a means of communicating with and controlling anembedded logic analyzer of the present invention. Advantageously, thestandard JTAG port is used to facilitate debugging of a programmablelogic device that includes an embedded logic analyzer. Use of a JTAGport avoids adding dedicated debugging control pins. In a firstembodiment for controlling an embedded logic analyzer using a JTAG port,inputs and outputs of the logic analyzer are routed to unbondedJTAG-enabled I/O cells. Cells that will provide control signals aretricked into thinking they are in INTEST mode so that signals may beinput, yet the rest of the device operates as in a real-worldenvironment. In a second embodiment, a user-implemented test dataregister provides a JTAG-like chain of logic elements through whichcontrol and output information is shifted. Stimulus cells providecontrol information to the logic analyzer, and sense cells retrieve datafrom the logic analyzer.

The present invention provides many advantages over the prior art. Useof an embedded logic analyzer in a PLD allows debugging of the device inthe system in which it is operating and under the actual conditions thatmight produce a malfunction of the PLD. The technique of the presentinvention automatically embeds a logic analyzer circuit into a PLD sothat an engineer may debug any logic function within the device. Theembedded logic analyzer is able to capture any internal signalsspecified by the engineer; the breakpoint can also include any specifiedinternal signals. Through the use of memory within the embedded logicanalyzer and an interface to the computer, any number and depth ofsignals can be monitored within the device and then transmitted to thecomputer at a later time for analysis. In one embodiment of theinvention, a JTAG port is used to program the embedded logic analyzerand to transmit captured signal information to the computer.

Advantageously, while debugging a PLD design in a system, an engineermay use the EDA tool to specify new signals to monitor and/or newbreakpoints. The engineer can then reprogram the device while it iswithin its intended system with a modified logic analyzer circuit veryrapidly in order to debug a different portion of the device or to changethe triggering conditions. This ability to reprogram an embedded logicanalyzer on the fly has many advantages over built-in debugging hardwareon custom chips that may not be dynamically reprogrammed. This abilityto reprogram also has advantages over external logic analyzers that canonly monitor the external pins of a hardware device. Furthermore, oncean engineer has finished debugging the device with the embedded logicanalyzer, the EDA tool may be used to generate a final configurationoutput file without the logic analyzer that represents the engineer'sfinal working design. Thus, the logic analyzer need not be part of thefinal design and take up space on the PLD.

The present invention is applicable to a wide range of hardware devices,and especially to PLDs. A PLD in particular may be implemented using awide variety of technologies, including SRAM technology and EEPROMtechnology. PLDs based upon SRAM technology are especially advantageousin that they may have additional embedded memory that can be used by theembedded logic analyzer to capture a large number of, and a greaterdepth of signals. Furthermore, an embedded logic analyzer that isdesigned and inserted automatically by an EDA tool means that anengineer does not require an external logic analyzer as a separate pieceof equipment. Furthermore, the engineer may use the computer on which heor she is creating a design for the PLD to also control and configurethe embedded logic analyzer and to review its results.

In one embodiment of the present invention, a number of pins on the PLDare dedicated interface pins for communication with the user computer.Because these pins are dedicated for the interface, and are known aheadof time, they may be routed to an easily accessible location or port ona circuit board, such that a debugging interface cable may be connectedfrom the user computer to these pins extremely easily. This technique isespecially advantageous where pins or contacts of a particularintegrated circuit in a package may be difficult or nearly impossible toreach. Because the embedded logic analyzer of the present invention maybe configured to monitor any internal or external signals of the PLD,all of these monitored signals are available for analysis through theseinterface pins. In other words, it is not necessary to physicallyconnect a probe to a particular external pin of interest because anysignal within the PLD can be monitored, stored within the memory of theembedded logic analyzer and then later uploaded to the user computer foranalysis through these dedicated interface pins.

Additionally, an embedded logic analyzer can be used with PLDs that areconfigured to near capacity. An engineer can temporarily remove aportion of the design unrelated to the problem under analysis, embed alogic analyzer circuit, and then debug the PLD. Once the PLD has beendebugged, the engineer may then remove the embedded logic analyzer andreinsert that section of the design that he had temporarily removed.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention, together with further advantages thereof, may best beunderstood by reference to the following description taken inconjunction with the accompanying drawings in which:

FIG. 1 is a block diagram of a programmable logic development systemaccording to one embodiment of the present invention.

FIG. 2 is a flowchart of a design methodology used to design aprogrammable logic device according to one embodiment of the presentinvention.

FIGS. 3A and 3B are a flowchart describing one technique by which alogic analyzer is programmed, embedded within a device, captures dataand dumps data for viewing by a user.

FIG. 4 is a flowchart describing a technique by which a logic analyzermay be compiled along with a user's design to embed the logic analyzerwithin a hardware device.

FIG. 5 is another view of the block diagram of FIG. 1, showing aprogrammable logic device having an embedded logic analyzer within anelectronic system.

FIG. 6 is a more detailed block diagram of a programmable logic devicehaving an embedded logic analyzer.

FIG. 7 illustrates an embedded logic analyzer showing its inputs andoutputs according to one embodiment of the present invention.

FIG. 8 is a block diagram of an embedded logic analyzer circuitaccording to one embodiment of the present invention.

FIG. 9 is a symbolic view of the operation of the control state machineof the embedded logic analyzer.

FIG. 10 is a table indicating the states and corresponding state outputsof the control state machine according to one embodiment.

FIG. 11 illustrates a first embodiment by which a JTAG port controls anembedded logic analyzer using unbonded I/O cells.

FIG. 12 illustrates a prior art JTAG-enabled I/O cell.

FIG. 13 illustrates a JTAG-enabled I/O cell according to the firstembodiment of FIG. 11.

FIG. 14 illustrates a second embodiment by which a JTAG port controls anembedded logic analyzer using a test data register.

FIG. 15 illustrates a stimulus cell that is an element of the test dataregister of FIG. 14.

FIG. 16 illustrates a sense cell that is an element of the test dataregister of FIG. 14.

FIGS. 17A and 17B illustrate an alternative embodiment in which anynumber of logic analyzers embedded within a device are controlled usinga JTAG port.

FIG. 18 is a block diagram of a typical computer system suitable forimplementing an embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In order to develop a design for programming an electronic design suchas a programmable logic device (PLD), a programmable logic developmentsystem is used. As used herein, “electronic design” refers to circuitboards and systems including multiple electronic devices and multi-chipmodules, as well as integrated circuits. For convenience, the followingdiscussion will generally refer to “integrated circuits”, or to “PLDs”,although the invention is not so limited.

Programmable Logic Development System

FIG. 1 is a block diagram of an embodiment of a programmable logicdevelopment system 10 that includes a computer network 12, a programmingunit 14 and a programmable logic device 16 that is to be programmed.Computer network 12 includes any number of computers connected in anetwork such as computer system A 18, computer system B 20, computersystem C 22 and computer system file server 23 all connected togetherthrough a network connection 24. Computer network 12 is connected via acable 26 to programming unit 14, which in turn is connected via aprogramming cable 28 to the PLD 16. Alternatively, only one computersystem could be directly connected to programming unit 14. Furthermore,computer network 12 need not be connected to programming unit 14 at alltimes, such as when a design is being developed, but could be connectedonly when PLD 16 is to be programmed.

Programming unit 14 may be any suitable hardware programming unit thataccepts program instructions from computer network 12 in order toprogram PLD 16. By way of example, programming unit 14 may include anadd-on logic programmer card for a computer, and a master programmingunit, such as are available from Altera Corporation of San Jose, Calif.PLD 16 may be present in a system or in a programming station. Inoperation, any number of engineers use computer network 12 in order todevelop programming instructions using an electronic design automationsoftware tool. Once a design has been developed and entered by theengineers, the design is compiled and verified before being downloadedto the programming unit. The programming unit 14 is then able to use thedownloaded design in order to program PLD 16.

For the purposes of debugging a PLD according to an embodiment of thepresent invention, any of the computers shown or others may be used tospecify a logic analyzer circuit and to compile such circuit along witha user's design. Furthermore, programming cable 28 may be used tocontrol the logic analyzer and to receive data from it, or a separatedebugging cable may be used to directly connect a computer with device16.

Such a programmable logic development system is used to create anelectronic design. Design entry and processing occurs in the context ofa “project”. A project includes a project file, design files, assignmentfiles, and simulation files, together with hierarchy information, systemsettings, and output files, which includes programming files and reportfiles. A project database may also exist, which contains intermediatedata structures and version information.

A project contains one or more hierarchies of design entities and eachdesign hierarchy tree has a root entity, which is the topmost designentity in that hierarchy tree (the top-level functional block). Otherdesign entities in the design hierarchy tree are called child entities.Also, a design hierarchy may contain entities for which there is nocorresponding design file, for example, in a top-down designmethodology. That part of a hierarchy which contains suchnot-yet-implemented entities is not compiled or simulated until a designfile is supplied for each entity. In this case, template source filesare automatically generated which have defined interfaces but emptybodies to assist in implementing these parts of a project. A usercreates a design by specifying and implementing functional blocks, aswill now be described in the context of an exemplary design methodology.

Design Methodology

FIG. 2 shows a design methodology 50 for using a system designspecification in order to develop a design with which to program a PLD.It should be appreciated that the present invention may be practiced inthe context of a wide variety of design methodologies. By way ofexample, the work group computing techniques and system of the presentinvention work well with an electronic design automation (EDA) softwaretool within the framework of the methodology of FIG. 2.

In step 52 a system specification for the PLD to be programmed isobtained. This specification is an external document or file thatdescribes, for example, the device pin names, the functionality of eachof the pins, the desired system functionality , timing and resourcebudgets, and the like. The multiple engineers within a work group willuse this system specification in order to create a design with the EDAtool that will then be used to program a PLD.

Once the system specification is obtained, creation of a design usingfunctional block diagrams is begun. In step 54 a top-level block diagramis created in which connections between lower-level designs blocks arespecified. In this block, the target device, speed grade, and key timingrequirements may be specified. Those skilled in the art will recognizethat this top-level block may also include blocks that have already beendeveloped or implemented or that have been obtained from a third partyprovider. This top-level block may also be converted into an HDL file,or the like, for use in other related design tools, such as an externalsimulator.

Step 56 includes generating design file templates with the EDA tool forall blocks present in the top-level block diagram of step 54. After thedesigner has created a block which has not yet been implemented, thesystem may generate a design file template. Such templates may display ablock in a window format including, for example, a title, a date, etc.around the boundaries. It may also include some details of thefunctional content depicted within the window. The design file templatesmay be in any specified design format including VHDL, AHDL, Verilog,block diagram, schematic, or other like format. In the case of a VHDLblock the template may also include much of the formatting and necessarysyntax for any VHDL block. The user need only take the template and addthe small portion of VHDL syntax required to implement his function. Forexample, the user may need only add syntax defining a particular ANDgate operation. Normal design, such as VHDL or other IEEE standard,requires large amounts of text to adequately set up the design block.

Those skilled in the art will recognize that design file templates suchas these can be used as starting points for the design of the structuralor functional entities needed by the design. Thus, a design filetemplate may serve as a reusable object for different instances of ablock in one or more designs. More importantly, design file templateswill be employed to reduce the amount of labor that the designer mustexpend to generate the logic in the blocks. In one embodiment, thegeneration of the design file templates is done in such a way that thetemplates can be updated later if the top-level block diagram changes.

Next, in step 58, each of the blocks of the top-level block isimplemented using the EDA tool. It is noted that for more complicateddesigns, there may be additional levels of block diagrams (i.e., blockswithin blocks). If changes are required at the top-level then thetop-level block diagram is updated and the sub-designs are preferablyautomatically updated as well.

Furthermore, a block may be compiled through to a fitting stage for aparticular integrated circuit die to provide information about resourceutilization, timing performance, etc., as required for a given design.As such, it is envisioned that some timing optimization may be performedduring step 58. This sequence illustrates a style of design in which anengineer first designs, then compiles and simulates, and then returns todesign again if the simulation results are not satisfactory. In anotherstyle, an engineer may iterate through a number of design followed bysimulation loops before finally compiling the complete design.

Concerning block implementation order, one or more of the followingfactors can be used to determine implementation order: (1) thecomplexity of a block; (2) the uncertainty or risk associated with ablock; and/or (3) how far upstream and/or downstream in a givendata-path the block resides. Each of steps 60, 62, 64, 68 and 70 mayalso lead back to this block implementation step for additionalimplementation necessitated by later changes in the design.

In step 60 a block is simulated functionally at the source level using abehavioral simulator and vectors generated by using a VHDL or Verilogtest bench, for example. The simulation results can then be displayed orotherwise presented/recorded as waveforms, text or annotated onto thesource files. The designer may also return to step 58 to implement ablock again. Also, at this point a block may be compiled or a timinganalysis performed.

Once the designer is satisfied with the simulation results, in step 62the block is combined with other blocks and the resulting group issimulated together. In some cases, it may be useful to complete a fullcompilation to provide critical resource and timing information. Also,output simulation vectors from one block may become the input simulationvectors to the next block. The designer may also return to step 54 tomodify the top-level block or to step 58 to implement a block again.

Next, in step 64, the entire design is simulated functionally at thesource level using a behavioral simulator. Preferably, the top-levelblock diagram is fully specified before simulation and shows completedesign connectivity. Vectors can be generated using a VHDL or Verilogtest bench. Again, the simulation results can be displayed either aswaveforms or annotated onto the source files. The designer may alsoreturn to step 54 to modify the top-level block or to step 58 toimplement a block again. In step 66 the entire design is compiledthrough to a file containing the information needed to program a PLD toimplement the user's design, such as to a “programming output file”.

A wide variety of compile techniques may be used depending upon the typeof design being created. By way of example, a few examples ofcompilation are presented below. For a PLD, compilation includes thesteps of synthesis, place and route, generation of programming files andsimulation. For a traditional integrated circuit design with a customlayout, compilation includes a layout version schematic, a design rulechecker and simulations. For integrated circuit design using a highlevel design tool, compilation includes synthesis from a language suchas VHDL or Verilog, automatic place and route and simulations. Forprinted circuit boards, compilation includes automatic routing, designrule checking, lumped parameter extraction and simulation. Of course,other types of compilation and variations on the above are possible.

Within the context of the present invention, any of the above compiletechniques may be modified in order to produce an embedded logicanalyzer. As will be discussed in greater detail below with reference toFIG. 4, the compilation of a PLD is modified in order to insert a logicanalyzer into a user's design.

Following compilation in step 66, in step 68 the timing checker insidethe compiler is used to determine if the performance goals for thedesign have been met. Also, timing simulations are used to checkperformance details. In addition, other analysis tools such as a designprofiler and/or layout editor can be used to further optimize theperformance of the design. Preferably, optimization is not performedprior to step 68 because full compilation is usually required toestablish the location of one or more critical paths within the design.The designer may also return to step 54 to modify the top-level block orto step 58 to implement a block again.

Next, in step 70 the device is programmed/configured using programmingunit 14 and tested in the system. Again, the designer may also return tostep 54 to modify the top-level block or to step 58 to implement a blockagain. While methodology 50 presents a top-down design process, it mayalso be used to support a bottom-up type methodology. Now that a generaldesign methodology has been described by which an engineer may develop adesign for a PLD, a technique for embedding a logic analyzer within aPLD will now be discussed.

Embedded Logic Analyzer

The flowchart of FIGS. 3A and 3B describe one possible technique bywhich a user may utilize the present invention in order to embed a logicanalyzer within a PLD to capture desired signals and to view the resultson a computer. In step 102 a user generates a design for a device andcompiles the design into an output file. A wide variety of EDA tools maybe used to generate and compile a design for a PLD. By way of example,the technique disclosed in U.S. patent application No. 60/029,277 may beused.

In step 104, the compiled output file is used to program the device andthe device is placed under operating conditions, such as on a printedcircuit board or within a suitable electronic system. At this step, auser may observe malfunctions with the device. If so, then in step 106 ahardware debugging feature of the EDA tool is enabled. This enablementwill allow the EDA tool to perform netlist augmentation. That is, theuser's design in various design files will be augmented with a logicanalyzer according to one embodiment of the present invention and isdescribed in greater detail in FIG. 4. This debugging feature alsoallows the combined netlist to be processed and programmed onto thedevice.

Next, the user is allowed to program the logic analyzer in order todebug the device in any way that the user chooses. One example of alogic analyzer circuit is shown in FIG. 8; the design for the logicanalyzer may already be present within the EDA tool, or may be generatedat any time. In step 108, the signals of interest of the device to bemonitored are specified. These are the signals that a user wishes toview in order to track down the cause of the malfunction. The signalsmay be those present on pins of the device, or any internal signals orpoints within the device. Often the nature of the malfunction observedin step 104 will provide a clue, suggesting signals that would likelyprovide further information about the problem. For example, if themalfunction is associated with data output at a particular pin, thesignals to be monitored may be provided by logic upstream from the pin.

These signals to be monitored may be specified in a wide variety ofways. By way of example, a hierarchical path name for each signal may bespecified, or a graphical user interface may be used to view aparticular design file and to select a signal or point from within thatfile to be monitored. In one alternative embodiment, the user may alsospecify which pins of the device will be used as an interface to theuser computer, i.e., those pins to be used to send control informationto the embedded logic analyzer within the PLD and to upload capturedinformation from the logic analyzer to the user computer. Preferably,though, the pins to be used as an interface are already known, such as aJTAG port of a device.

In step 110, the total number of samples to be captured are specified.In other words, the depth of the sample memory is specified and this, inturn, indicates on how many clock pulses data will be acquired by thelogic analyzer. The total number of samples to be captured includes allsamples to be captured whether before or after a specified breakpoint.In other words, the specified number indicates a width of a window ofdata to be captured; the window may encompass the breakpoint, may occurcompletely before the breakpoint, or may occur completely after thebreakpoint.

In one embodiment of the invention, a PLD that includes embedded memoryblocks (such as any of the FLEX 10K family of devices available fromAltera Corporation) works well for implementing the present invention.The embedded memory blocks are easily programmed to provide relativelylarge buffers (as part of the logic analyzer circuit) for the storage ofcaptured information. Embedded memory devices are not, however,necessary for the buffering of information captured. Although deviceswithout embedded memory may be used with the present invention, they donot lend themselves as easily to the creation of relatively largebuffers. In devices without embedded memory, buffers may be implementedover multiple cells, using available memory from each cell.

In step 112, a system clock signal is specified for use by the logicanalyzer. Any of a variety of signals available within the device may bespecified as a system clock signal. A device clock signal that isrelevant to the signals being monitored will typically be chosen as asystem clock signal. A multiple of a device clock signal may also bechosen in order to sample signals more frequently.

In step 114, a breakpoint is specified. A breakpoint may include anynumber of signals to monitor and the logic levels that those signalsmust have to trigger the logic analyzer, i.e., the breakpoint describesa particular state of the device. A breakpoint may be as simple as onesignal changing state, or may be a complex pattern of signals or asequence of patterns that occur before to trigger the logic analyzer.Also, a breakpoint need not be specified in all cases; if not, the logicanalyzer immediately begins capturing data upon running. Advantageously,the breakpoint can be changed at any time by the user through the use ofthe EDA tool, and a new breakpoint can be downloaded to the embeddedlogic analyzer in the device without having to recompile all of thedevice design files. By allowing breakpoints to be changed rapidly for adevice within a system, debugging is much more efficient.Advantageously, the present invention can acquire data not only afterthe breakpoint, but also before it occurs.

In step 115 the user specifies the number of data samples to be capturedprior to the breakpoint. Advantageously, the user may specify any numberof samples to be captured prior to the breakpoint occurring, thusallowing later analysis of these prior signals to help determine thecause of a failure, error or other condition. As explained below inFIGS. 8-10, implementation of the embedded logic analyzer allows samplesto be stored continuously which provides a user with any number ofsamples needed prior to the breakpoint. Alternatively, a user mayspecify the number of samples needed after the breakpoint. Because thetotal number of samples to be captured has been specified in step 110,it is straightforward to calculate prior samples needed based upon latersamples needed, and vice-versa. The user may also specify samples neededprior to the breakpoint and samples needed after the breakpoint; totalsamples to be captured can then be calculated automatically.

In addition to being able to specify number of samples to be captured instep 110 and number of samples needed prior to the breakpoint in step115, these values may also be specified after the user's design andlogic analyzer have been compiled. In other words, while steps 110 and115 specify certain values before compilation of the design, thesevalues may also be input to the logic analyzer once the PLD has beenprogrammed or even while the logic analyzer is running. For example,register 310 of FIG. 8 may be set at any with the value Delay [6:0] toindicate the number of samples to be captured after the breakpointoccurs. The total number of samples to be captured is equal to thenumber of words in sample memory 324. Other values specified beforecompilation can also be specified after compilation in a similarfashion, for example trigger register 304.

Once the user has specified how he or she wishes the embedded logicanalyzer to function, the complete design is compiled. In step 116, theuser issues a compile command to compile the user's device design alongwith the logic analyzer design that has been specified. In a preferredembodiment of the invention, the design files are not modified duringthis process. The logic analyzer design is incorporated into the outputfiles produced. In one specific embodiment, the process shown in FIG. 4may be used to implement step 116. Of course, other similar techniquesmay also be used.

The result of this step is a new output file that includes the user'sdesign with an embedded logic analyzer. A technique by which an EDA toolmay insert a custom logic analyzer in a design will be discussed ingreater detail below with reference to FIG. 4. Once the new output filehas been generated, in step 118 the device is reprogrammed within itssystem using the new output file.

In step 120, the user connects a debugging interface cable from thedevice to the user's computer. The interface cable may be the same cableused to program the device or it may be a dedicated cable for debugging.In one embodiment of the invention, the debugging cable connects to pinsthat have been specified by the user in step 108 as being dedicated tothe logic analyzer circuit. In other words, if the user has specifiedthe pins to which the debugging cable will be connected, the cableshould be connected to those pins. In an alternative embodiment, theuser need not specify the “debugging pins,” rather the system specifiesthem automatically. In other embodiment, a dedicated JTAG port of thedevice may be used.

The cable may attach directly to these pins, or, the signals from thesepins may be routed to an easily accessible location or port on the boardto which the debugging cable may easily attach. The cable will be usedto transmit instructions from the computer to the embedded logicanalyzer, and also to upload captured information from the logicanalyzer to the computer. As discussed below, FIG. 5 shows a PLDcontaining both a user design and an embedded logic analyzer within anelectronic system. A cable 28 is shown connecting the electronic systemto an external computer.

In step 122 the user through the EDA tool requests the embedded logicanalyzer to begin running with an appropriate command. Once the logicanalyzer begins to run, in step 124 it begins to continuously capturedata from the signals that have been specified to be monitored.Preferably, the user then manipulates the system to duplicate previousmalfunctions that the user wishes to analyze. The captured data isstored within memory of the PLD, and is preferably stored withindedicated memory within the embedded logic analyzer itself. Step 126determines whether a breakpoint has occurred. In other words, the logicanalyzer determines whether the state of the signals specified to bemonitored are equivalent to the breakpoint that the user has specified.If not, then the logic analyzer continues to capture data. If so, step128 determines whether more samples should be captured and stored afterthe breakpoint. Step 128 may be implemented by comparing the totalnumber of samples desired with the number of samples that have alreadybeen stored prior to the breakpoint. If more samples are to be stored,then in step 130 the logic analyzer continues to store the desirednumber of samples after the breakpoint.

Once the total number of samples desired by the user have been capturedand stored, the stored data is dumped from the sample memory of thelogic analyzer to the user's computer in step 132. Preferably the logicanalyzer uploads this stored information over the interface cable to theuser's computer. In step 134 the user is able to graphically view thesesignals received from the logic analyzer. In one embodiment, the signalsare presented in a waveform view annotated with the names of thesignals. Thus, by viewing these signals of interest on a computer, auser is able to efficiently debug a hardware device in much the same wayas if an external logic analyzer had been able to be connected to thesesignals.

FIG. 4 is a flowchart 200 that describes a technique by which a logicanalyzer circuit may be automatically inserted into, and automaticallycompiled along with, a user design. The technique of FIG. 4 is asuitable technique by which step 116 of FIG. 3B may be implemented (inthe context of PLD compilation). It should be appreciated that a varietyof compilation techniques may be used with the various EDA tools, forPLD design as well for other types of integrated circuits. Theembodiment of FIG. 4 illustrates how the present invention may be usedwith one such compilation technique, although it is contemplated thatthe present invention is applicable to any of a wide variety ofcompilation techniques.

In step 202 an EDA tool accepts the user design files necessary todescribe an electronic design for a device such as a PLD. These designfiles may often specify the design elements for the design. In manydesign environments, the design elements are arranged in a hierarchy,from root entity to leaf entities. In such cases, if the design uses aparticular register in numerous locations throughout the design, theremay be only one file containing the implementation of this design, yetthe complete design may reference that one file in numerous locations.Examples of such electronic design files are discussed above withreference to FIGS. 1 and 2.

Step 204 takes these user design files and generates a flattened netlistrepresentation of the user design. In other words, should the designfiles include a hierarchy, this hierarchy is “flattened out” so thateach entity referenced in the design is duplicated as many times as itis used. Using the above example, if a particular register is used twicein the design hierarchy, yet only one file exists to describe thisregister, this step flattens out the design by producing two such filesfor the register. The representation of the user design in this step ispreferably a synthesized technology-mapped database that will beappreciated by those of skill in the art. At this point in the compileprocess, a synthesized netlist of the user design has been created in aflattened state. Typically, generation of such a netlist is referred toas a “synthesis” step in the compilation process, after elaboration hasoccurred.

In step 206, a gate level representation of the logic analyzer circuitis produced. The logic analyzer circuit may take a wide variety offorms. By way of example, logic analyzer circuit 260 of FIG. 8 may beused, although it should be appreciated that a logic analyzer circuitmay be implemented in many ways while still performing the functionalityof the circuit shown in FIG. 8. In a preferred embodiment of theinvention, a logic analyzer circuit is included in the EDA tool so thata gate level representation may be produced automatically.Alternatively, a user could be allowed to specify a custom circuit. Thisgate level representation takes into account each logic element of thecircuit, along with the number and names of the signals to monitorspecified by the user in step 108, the number of samples to be capturedspecified in step 110, number of samples needed prior to breakpointspecified in step 115, and the breakpoint as specified in step 114.Those of skill in the art will appreciate the process by which a gatelevel representation of a particular circuit is produced.

The actual gate level representation of a particular logic analyzercircuit will depend upon the particular device in which the logicanalyzer will be embedded. By way of example, the hardware device inwhich to embed the logic analyzer may include any of the PLD devicesavailable from Altera Corporation. In particular, any of the FLEX 10K,FLEX 8000, MAX 9000, or MAX 7000 devices work well. Each of theseparticular devices may have different features that would affect how agate level representation for a logic analyzer is produced. For example,for a FLEX 10K device with relatively large embedded memory sections,this embedded memory is particularly well suited for implementing alarge FIFO (first in first out) memory for the logic analyzer. For adevice such as the FLEX 8000 without embedded memory, the memoryelements (such as SRAM flip-flops) of logic cells may be used for thememory of the logic analyzer but the FIFO buffer may have to be dividedover multiple cells if the memory in a single cell is not sufficientlylarge to accommodate the buffer. Similarly, a device based upon EEPROMtechnology may also use one or more of its logic cells for the logicanalyzer's buffer. A device having large embedded memory worksparticularly well with the present invention because of the largercapacity for signal storage. Thus, step 206 produces a representationfor a logic analyzer circuit that is to be connected to the user'sdesign.

In step 208 the gate level representation of the logic analyzer circuitfrom step 206 is connected to the flattened representation of the userdesign of step 204. This step makes the logic connections from theinputs of the logic analyzer (breakpoint signals, system clock, signalsto monitor) to lines providing the actual signals specified in theuser's design. As those signals have previously been specified in steps108 through 115, the EDA tool is able to find the particular signallines within its database representation of the electronic design and tomake the appropriate connection to an input of the logic analyzer.

In addition, this step makes appropriate connections from the logicanalyzer to an interface to the user's computer. In the embodiment ofFIG. 6, discussed below, this interface includes test data registers 274linked to JTAG port 272. Accordingly, input and output connections toand from the logic analyzer that provide an interface to the usercomputer are connected to the appropriate test register. For example, asshown in FIGS. 7 and 8, input signals (from the user computer to thelogic analyzer) Trigger Signals, Trigger Register, Set Delay,Delay[6:0], NextReq, StopReq, RunReq, and Clear are connected toappropriate test registers. Output signals (from the logic analyzer tothe user computer) DataOut[15:0], NumSamples[7:0], Triggered and Run arealso connected to the appropriate test register. Test registers arepreferably constructed from programmable logic, and will be familiar tothose of skill in the art.

Of course, another embodiment of a logic analyzer circuit may usedifferent signals and/or a greater or fewer number of interface signals.In a preferred embodiment of the invention, these interface signals toand from the logic analyzer are connected to dedicated pins on the PLDreserved for this purpose. Thus, a user will know to which pins thedebugging cable should be attached. As noted, these pins not onlycontrol the embedded logic analyzer, but also receive data from it. Inother embodiments, these dedicated pins may be routed to another part ofthe circuit board for easy attachment of a cable. In this fashion, thelogic for the logic analyzer circuit created in step 206 is connected toboth the user design and to interface pins of the PLD for communicationwith the user computer.

In step 210 the complete design created in step 208 is placed and routedin a fashion that will be appreciated by those of skill in the art. Theoutput of the place and route step is then input to step 212 in whichthe output file is assembled. This output file may then be downloaded toa PLD in order to program it. Once a PLD has been programmed with thisfile, a user may begin use of the embedded logic analyzer in order todebug the device.

FIG. 5 is another view of programmable logic development system 10 ofFIG. 1, showing a programmable logic device having an embedded logicanalyzer within an electronic system. System 10 shows an electronicsystem 252 connected to computer system A 18 via cable 28 or otherconnective appliance. Electronic system 252 includes PLD 16, a componentof the electronic system. PLD 16 potentially shares one or moreelectronic connections 254 with the other components and elements thatmake up the electronic system. PLD 16 has been configured with a userlogic design 256 and an embedded logic analyzer 260. User logic 256 isconfigured with a design according to the methodology described in FIG.2, or any other suitable design methodology. Embedded logic analyzer 260has been incorporated into PLD 16 according to one embodiment of theinvention described in FIGS. 3A and 3B.

Logical connections 262 allow signals from user logic 256 to betransmitted to logic analyzer 260. These signals may include a systemclock, trigger signals, signals to monitor, etc. Pins of PLD 16 are usedto connect interface signals 264 from the logic analyzer tocorresponding connections 266 in electronic system 252. Cable 28 is usedto connect these interface signals to computer 18. Alternatively,computer 18 may be directly connected to PLD 16 to transmit interfacesignals 264 to the PLD. In this manner, computer 18 transmits commandsand other information to embedded logic analyzer 260, and receivesinformation from the logic analyzer without directly interrupting oraffecting the functional operation of electronic system 252. PLD 16 isthus configured to perform both the functions of user logic 256 andembedded logic analyzer 260.

Those of skill in the art will appreciate that the actual interface usedbetween logic analyzer 260 and an external computer system may take avariety of forms. The embedded logic analyzer as herein described may becontrolled by an outside computer using any suitable interface on thePLD. Furthermore, the exact number of pins on PLD 16 used to controllogic analyzer 260 and to receive data from it may vary depending uponthe device being programmed, the overall board design, etc. It willfurther be appreciated that pins used may be flexibly assigned, or thatdedicated interface pins may be used. For example, interface signals 264that provide an interface between logic analyzer 260 and external pinsof PLD 16 may be implemented as described in the above-referenced U.S.patent application No. 08/958,435. Other techniques for controlling anembedded logic analyzer and for receiving output data may also be used.

FIG. 6 illustrates another view of PLD 16 showing a preferred embodimentfor controlling a logic analyzer using the JTAG port of the device inwhich the logic analyzer is embedded. Not shown for clarity within PLD16 is user logic 256. In this preferred embodiment, interface signals264 are implemented using a JTAG port 272 in conjunction with controllogic 274 and signals 275. A JTAG (Joint Test Action Group) port 272 isimplemented under the IEEE 1149.1 standard and is known to those ofskill in the art. Control logic 274 provide buffering between logicanalyzer 260 and JTAG port 272 for particular signals that are describedbelow in FIG. 7. More specifically, control logic 274 supplies controlsignals to logic analyzer 260 and assists with retrieving data andstatus from the logic analyzer.

In this embodiment, JTAG port 272 includes signals TCLK, TMS, TDI andTDO. Signal TCLK is a clock signal that controls the rate of serial datain and out of JTAG port 272. Signal TMS is a mode select signal thatselects any of the sixteen states of the JTAG port. Signals TDI and TDOare serial data in and serial data out, respectfully.

Typically, a JTAG port is used either to program a PLD or to assist withtesting a circuit board on which PLDs are located. Advantageously, it isrealized that a JTAG port has traditionally been unused during thedesign and debugging of a particular PLD. Thus, it is further realizedthat a JTAG port on a PLD is under utilized and may be used duringdebugging of a PLD as a means of communicating with and controlling anembedded logic analyzer of the present invention. Advantageously, astandard JTAG port is used to facilitate debugging of a programmablelogic device that includes an embedded logic analyzer. Two particularembodiments for implementing control logic 274 to facilitate control ofan embedded logic analyzer by a JTAG port are described below in FIGS.11-13 and 14-17, respectively.

FIG. 7 illustrates the input and output signals for embedded logicanalyzer 260 according to one embodiment of the present invention.Signals DataIn 280 are the signals specified by the user in step 108that are to be monitored for the purpose of debugging the PLD. SignalSetDelay 281 is a control line that causes register 310 to be loaded bythe value of signal Delay 282 which indicates the number of samples tobe captured following a breakpoint. Signal Delay 282 indicates thenumber of samples to be captured following a breakpoint and is receivedfrom computer system 18 after being specified by the user. SignalBreakpoint 283 indicates to the logic analyzer when a breakpoint hasoccurred. This signal is generated from trigger comparator 306 withinthe logic analyzer, or may be generated within the user designed logic.

Signal NextReq 284 is received from computer system 18 and allowsretrieval of stored sample data a sample at a time, and indicates thatthe next sample should be uploaded to computer system 18. Signal StopReq285 is received from computer system 18 and directs the logic analyzerto enter its stop state and to stop capturing signal samples. SignalRunReq 286 is received from computer system 18 and directs the logicanalyzer to begin running and capturing sample data. Signal DoneDump 287directs the logic analyzer to discontinue dumping data from its memoryto the computer system and to enter a stop state. This signal may bereceived from within the logic analyzer or from the user. Signal Clock288 is the system clock signal specified in step 112. Signal Clear 289is a reset signal that clears control state machine 302, sample memory324 and counter 314.

Signals DataOut 290 are the output signals from sample memory 324 thattransfer captured signals a word at a time from logic analyzer 260 tocomputer system 18 via interface 264. Signal NumSamples 291 indicatesthe number of valid samples captured by logic analyzer 260. Because theactual number of valid samples captured by the logic analyzer may beless than the total number of samples requested by the user, this signalassists the user in determining which are the valid samples stored inmemory. For example, the user may desire to capture a total of 128samples but does not wish to store any samples after a breakpointoccurs. If a breakpoint occurs after only sixty-four samples have beencaptured, the signal NumSamples 291 will have a value of sixty-four,thus indicating that only sixty-four samples stored in the logicanalyzer are valid samples. Any samples stored beyond the sixty-fourwill not be valid samples; they may have been present from an earlierdata capture. Signal Triggered 292 is an output signal for the user thatindicates that a breakpoint has occurred. Signal Run 293 indicates tothe user that signal RunReq 286 has been received and that the logicanalyzer is running and capturing data.

FIG. 8 illustrates embedded logic analyzer 260 according to oneembodiment of the present invention. A logic analyzer to be embeddedwithin a PLD may be implemented in a wide variety of manners dependingupon the type of PLD, signal type and number to be monitored, depth ofdata desired, memory available, control signals from the user's computerand preferences of the designing engineer, etc. By way of example, logicanalyzer 260 is one particular example of how such a logic analyzer maybe implemented. The embedded logic analyzer is controlled by the userfrom a computer external to the PLD and operates to capture any of avariety of internal signals that the user wishes. In this embodiment ofthe invention, logic analyzer 260 includes control state machine 302,trigger register 304, trigger comparator 306, registers 308 and 310,counters 312-316, comparators 320, 322 and sample memory 324.

Once logic analyzer 260 has been programmed into a PLD, it receives avariety of inputs from signals within the PLD. Trigger signals 305 arethose signals specified in step 114 that the user wishes to compare to atrigger condition stored in trigger register 304 that was also specifiedin step 114. Together, trigger signals 305 that satisfy the triggercondition result in a breakpoint. Trigger comparator 306 comparessignals 305 to the trigger condition and generates a breakpoint signalwhen appropriate.

Control state machine 302 may be any suitable control structure forcontrolling the embedded logic analyzer and is described in greaterdetail in FIG. 9. Preferably, state machine 302 is implemented inprogrammable logic using any of a variety of look-up tables, embeddedmemory blocks, ROM registers, etc. Input signal DelayDone is receivedfrom comparator 320 and indicates that the total number of samplesrequested by the user have been captured. Signals NextReq, StopReq,RunReq, DoneDump, Clock and Clear have been described above. Inputsignal Breakpoint to state machine 302 is received from triggercomparator 306 via register 308.

Register 308 is a synchronizing register used to shield state machine302 from an asynchronous breakpoint signal. Register 308 allows theinput signal breakpoint to be input on a clock cycle.

Output signal Stopped is active when state machine 302 is in its stopstate. This signal resets counters 312 and 316 and prepares the logicanalyzer to begin running anew. It also permits data from register 310to be loaded into counter 314. Output signal Next when active enablescounter 312 to increment an address in sample memory 324. Addresses areincremented while the logic analyzer is running and capturing data andwhile sample memory 324 is stepping though its addresses and dumpingsample data to computer system 18. Output signal Triggered is used toenable counter 314. Signal Run is combined in gate 340 with signalPrevDataFull to enable counter 316.

Register 310 accepts signal Delay in order to store the number ofsamples following a breakpoint that a user wishes to capture. Its clockis the input signal SetDelay.

Counter 312 increments addresses for sample memory 324 during samplingand capturing data, and increments addresses during reading data out tocomputer system 18. Counter 314 is a down counter that creates a delayfrom an observed breakpoint in order to allow the logic analyzer tocontinue capturing data until the last sample desired by the user hasbeen stored. Counter 314 is loaded from register 310 with signal Delaywhich indicates the number of samples past the breakpoint that should bestored. Once counter 314 counts down and reaches a value of zero,comparator 320 performs a successful comparison with a hardwired zerovalue and asserts signal DelayDone. Signal DelayDone when assertedinstructs control state machine 302 to move from a run state to a datadump state.

Counter 316 counts the number of valid samples that have been stored insample memory 324. As discussed above, a situation may occur in whichthe number of valid samples captured is less than the originallyspecified total number of samples desired by the user. In thisillustrative example, sample memory 324 has a capacity of 128 words.Thus, when counter 316 reaches the value 128, comparator 322 performs asuccessful comparison with a hardwired value 128. Accordingly, outputsignal PrevDataFull is asserted and its inverse is input to gate 340.The inverse of an asserted signal PrevDataFull disables counter 316,thus indicating the total number of valid samples stored in samplememory 324. Counter 316 also continuously outputs signal NumSamples thatindicates the total number of valid samples that have been captured tothat point in time.

Sample memory 324 is memory within PLD 16 that may be implemented in anysuitable fashion. By way of example, memory 324 may be implemented usingsets of registers or using embedded memory blocks within the PLD. In onespecific embodiment of the invention, embedded SRAM memory is used toimplement memory 324. Of course, memory 324 may be implemented in manytypes of PLDs that do not contain extra embedded memory. Preferably,sample memory 324 is implemented as a ring buffer such that incomingsample data is continuously stored in memory 324 when the logic analyzeris running. As memory 324 fills, it wraps around to its beginning andthe oldest data stored is overwritten by new incoming data. Forillustrative purposes, sample memory 324 is shown implemented using RAMmemory of 128 words of 16 bits each. Of course, any of a variety ofsizes of memory may be used. The width of the memory may be increased tocapture more data signals and its depth may be increased to store agreater history of signals.

FIG. 9 is a state diagram for control state machine 302. FIG. 10 is atable illustrating the value of output signals associated with each ofthe five states of state machine 302. It will be appreciated by those ofskill in the art that control state machine 302 may be implemented usingany suitable logic and need not necessarily be implemented as a statemachine. If implemented as a state machine, a variety of state machinessuch as a Moore or a Mealy state machine may be used. In a preferredembodiment of the invention, state machine 302 is implemented as a Moorestate machine as will now be described with reference to both FIGS. 9and 10.

State machine 302 includes the states Run 402, Delay 404, Stop 406,DataDump 408 and Next 410. When in the Stop state the output signalStopped is asserted and the other output signals Run, Triggered and Nextare in a “don't care” condition. The Stop state is maintained untilinput signal RunReq becomes asserted which causes a transition to theRun state.

When in the Run state, output signals Run and Next are asserted and theoutput signal Triggered is a zero because a breakpoint has not yetoccurred. While both input signals Breakpoint and StopReq remainunasserted, the Run state is maintained. If a StopReq signal isreceived, the state machine enters the Stop state. If a Breakpointsignal is received and signal DelayDone remains unasserted (indicatingthat more samples are to be captured) the system enters the Delay state.On the other hand, should a Breakpoint signal be received and signalDelayDone is asserted, this indicates that not only has a Breakpointoccurred but that no signals occurring after the Breakpoint need becaptured. In this situation, the state machine enters the DataDumpstate.

While in the Delay state signals Run, Triggered, and Next are asserted,while output signal Stopped is unasserted. The Delay state indicatesthat the logic analyzer is still running and capturing data after atriggering condition has set the breakpoint. The state machine remainsin this state until all of the required samples after the breakpointhave been captured. Accordingly, while signal DelayDone is unassertedthe Delay state is maintained. As soon as counter 314 counts down andindicates that all required samples after the breakpoint have beencaptured, signal DelayDone has become asserted and the state machineenters the DataDump state.

While in the DataDump state, all output signals are unasserted. In thisstate, data is dumped from sample memory 324 to computer system 18. Whenthe signal DoneDump is asserted, the logic analyzer has finisheduploading data to computer system 18 and the state machine moves fromthe DataDump state to the Stop state. The state machine remains in theDataDump state while signals NextReq and DoneDump are both unasserted.As described earlier, it is possible for computer system 18 to requestan upload of a word at a time from sample memory 324. In this situation,computer system 18 asserts input signal NextReq causing the statemachine to enter the Next state.

While in the Next state, all output signals except for output signalNext are unasserted. As long as the logic analyzer continues to receivean asserted signal NextReq it uploads a word at a time to computersystem 18. As soon as signal NextReq becomes unasserted, the statemachine returns to state DataDump.

JTAG Port Control Overview

As described above with reference to FIG. 6, a preferred embodiment ofthe invention uses JTAG port 272 along with control logic 274 andsignals 275 for controlling logic analyzer 260. It is realized that useof a JTAG port for control of a logic analyzer would be advantageous inthat a JTAG port is often already present on a PLD. Furthermore, use ofa JTAG port would obviate the need to add extra, dedicated debuggingcontrol pins. Furthermore, many manufacturers of PLDs already havefacilities for connecting and communicating through a JTAG port of aPLD. For example, Altera Corporation of San Jose, Calif. uses aninternal product known as “Byte Blaster” to program a PLD through a JTAGport. For these reasons and others, it is realized that use of a JTAGport to control an embedded logic analyzer would be advantageous.Nevertheless, how to implement such control using a JTAG port is notintuitively obvious for a variety of reasons.

For background, more detail on use of a JTAG port will now be provided.A JTAG testing device tests a hardware device having a JTAG port bybasically taking over control of the pad ring of the device. In otherwords, the JTAG tester takes over control of the drivers for each pin,effectively isolating the core of the device from the outside world.Using the JTAG port of the device then, the JTAG tester is able to puteach pin into one of three states: drive, sense, or tri-state. The JTAGtesting device is primarily used in an EXTEST mode to perform a fullboard test of the physical connections between devices on a board. Bydriving a pin on one device to output a signal, and sensing an input onanother device on the board, the JTAG tester in this mode is able totest the physical connection between the devices while on the board. Assuch, EXTEST mode would be unsuitable for controlling an embedded logicanalyzer. The INTEST mode is used less often and is used to internallytest a device. As above, the JTAG testing device takes control of eachpin driver and isolates the core. Test signals may then be driven intothe core and output signals may be sampled and their accuracydetermined.

Unfortunately, because the INTEST mode disconnects the core of thedevice from the outside world, the PLD is not being tested in areal-world environment on the circuit board. As previously explained, itis often necessary to test a PLD within the real-world environment of anoperating circuit board in order to track down elusive malfunctions.Furthermore, a JTAG port is only a 10 MHz serial port, and is thus notable to provide the high-speed volume of data that might occur in areal-world environment. Thus, actual high speed operating conditionswould be desirable. Additionally, during a JTAG test, the engineerprovides contrived test vectors that may not be representative ofreal-world signals that the PLD would receive in a true operatingenvironment. For these reasons and others, it may not be particularlydesirable to attempt to control an embedded logic analyzer of a PLDusing the INTEST mode of the JTAG port. Nevertheless, it is realizedthat using a JTAG port in some fashion to control an embedded logicdevice would be desirable. Advantageously, the present inventioncontemplates two embodiments by which JTAG port 272 controls embeddedlogic analyzer 260 of a PLD 16. Advantageously, a JTAG port is used tocontrol the embedded logic analyzer while the PLD in which the logicanalyzer is embedded is allowed to operate on the circuit board in areal-world environment. These two embodiments are presented below inFIGS. 11-13 and FIGS. 14-17, respectively.

First JTAG Control Embodiment

FIG. 11 illustrates a first embodiment by which JTAG port 272 controlsembedded logic analyzer 260 of PLD 16 using groups of unbonded I/O cells504 and 506. Logic analyzer 260 is embedded in core 502 of PLD 16 andhas a system clock 288. Cells 504 deliver signals 514 to the logicanalyzer, and cells 506 receive signals 516 from the logic analyzer.Signals 275 represent signals from JTAG port 272 to and from I/O cells504 and 506. Included are: signal TDI that connects to serial data in(SDI) of the first input cell 504; TDO that connects to serial data out(SDO) of the last output cell 506; and control signals such as Shift680, Clock 682, Update 684, and Mode 686 that are provided to each cellas required. In this embodiment, JTAG-enabled I/O cells 504 are used tocontrol logic analyzer 260 via input signals 514. Output data and statusinformation signals 516 from logic analyzer 260 is connected toJTAG-enabled I/O cells 506.

To implement this embodiment, the netlist of the PLD is augmented toroute each input to and each output from logic analyzer 260 to anunbonded or otherwise unused I/O cell 504 or 506, respectively. Aspecial “debug RAM bit” is set for each I/O cell that is used to supplya control signal to the logic analyzer; this bit allows a control signalto be driven using the JTAG port even though the device is not placedinto INTEST mode. To generate a control signal for delivery to logicanalyzer 260, the known JTAG Sample/Preload instruction is scanned in,the control information is scanned in, and then the Update/Data Recoverystate of JTAG port 272 is entered. Further details are provided below.To better illustrate the advantages of this embodiment, the known JTAGINTEST mode will be briefly described.

FIG. 12 illustrates a prior art JTAG-enabled I/O cell 600 that providesa useful background for discussion of this embodiment. Cell 600 connectsto an external PLD pin 602. Through pin 602, input signal 604 isprovided to core 502 of PLD 16. Similarly, signals output 606 and outputenable 608 originate within core 502 and are used to produce an outputsignal at pin 602. Multiplexers 610, 612 and 614 select data to beloaded into capture registers 620, 622 and 624, respectively. Thecapture registers are used to scan in data initially from JTAG port 272through the I/O cells of the device. Update registers 630, 632 and 634receive data from the capture registers and are used to perform aparallel load to the core of the device. Multiplexers 640, 642 and 644select data from either pin 602 input, output enable 608, and output606, respectively, or from one of the update registers to produce anappropriate signal. Multiplexer 640 produces input signal 604,multiplexer 642 produces a tri-state signal for driver 650, andmultiplexer 644 provides a data signal for driver 650 which produces anoutput at pin 602 when enabled.

Operation of JTAG-enabled cell 600 will be appreciated by those of skillin the art. Serial data in 672 is a signal received from the previousI/O cell (or from the TDI signal of JTAG port 272 if this is the firstcell), and serial data out 674 is connected to the serial data in signalof the next I/O cell (or to signal TDO of JTAG port 272 if this is thelast I/O cell). Control signals Shift 680, Clock 682, Update 684 andMode 686 are received for each cell from JTAG port 272 via control lines275. Shift 680 operates to shift the serial data in signal 672 throughcell 600. Clock 682 clocks the capture registers to capture the serialdata, and update 684 clocks the update registers to enable a parallelload. Mode 686 allows cell 600 to either be in a normal mode (mode=0) orto be in the INTEST or EXTEST mode (mode=1). In typical JTAG operation,when mode 686 places the device in INTEST or EXTEST mode, signals output606, output enable 608 and input 604 are effectively cut-off from pin602, and thus, core 502 of the device is isolated from the outsideworld. As discussed earlier, it would be undesirable to place the devicecompletely into INTEST mode if it is desired to test the device in areal-world environment. For example, if mode 686 places the device intoINTEST mode, all pins of the device would be isolated from its core andnormal operation of the device would be prevented.

In standard JTAG INTEST mode, JTAG port 272 first enters a serial shiftmode in which serial data received over line TDI is shifted through allI/O cells of the device until the appropriate data is present at theappropriate input cell. Then JTAG port 272 enters a parallel load modein which all of the data recently shifted into the I/O cells is thenloaded in parallel into core 502 to supply input signals as required bya particular test. Concurrently or subsequently, JTAG port 272 may be ina parallel sense mode for various I/O cells that receive the output fromthe test. Once this test data has been received, JTAG port 272 againenters the serial shift mode and data is shifted serially out of the I/Ocells to be output from JTAG port 272 over line TDO. In this fashion,the INTEST mode of JTAG port 272 uses JTAG-enabled I/O cells to providecontrived test data to core 502 and to receive outputs from that test.

As described above, however, using the true INTEST mode can bedisadvantageous in that the INTEST mode disconnects all pins of PLD 16form core 502. Thus, PLD 16 is not operating in a real-world environmentand use of logic analyzer 260 in this mode might not provide true testresults. Advantageously, the present invention makes use of unbonded I/Ocells 504, and tricks certain of these cells into thinking that they arein INTEST mode to allow control of logic analyzer 260 by JTAG port 272.

It is realized that many PLDs may have extra I/O cells 504 and 506 thatare unbonded to a pin of the PLD yet are still electrically connected tocore 502. Advantageously, the present invention realizes that theseunbonded I/O cells 504 and 506 can be used not only to supply controland data information to logic analyzer 260, but also that they may beused to receive status and output information from the logic analyzer aswell. Furthermore, this embodiment does not use the true INTEST mode;thus PLD 16 may be operated in a real-world environment and logicanalyzer 260 may capture real test data. In order to still providecontrol and input information via unbonded I/O cells 504 over lines 514,these cells are tricked into thinking that they are actually in INTESTmode so that they will drive logic analyzer control signals inward fromthe cell to core 502. These inwardly driven signals may then be used toprovide control and input data for logic analyzer 260. Advantageously,no extra logic is required to implement this method of control.

Using this technique, only I/O cells 504 that are tricked into thinkingthey are in INTEST mode will be driven inward. In this fashion, controland data signals are provided to logic analyzer 260 using unbonded I/Ocells 504 that are not connected to any pins of PLD 16. Because cellscorresponding to unused pins of PLD 16 are being used for control anddata input/output of logic analyzer 260, the remaining pins of PLD 16communicate with core 502 and with the outside world in a true operatingenvironment and are unaffected by this control method.

FIG. 13 illustrates an unbonded I/O cell 504 according to this firstembodiment of JTAG control. Additionally included in cell 504 is gate702 and debug RAM bit 704. In this embodiment, mode 686 places PLD 16into its normal mode of operation so that logic analyzer 260 can capturereal-world data. In this mode, pins of the PLD are not isolated fromcore 502. For unbonded I/O cell 504, however, it is still desirable tobe able to use JTAG port 272 to provide a control signal to embeddedlogic analyzer 260. To these ends, gate 702 and debug RAM bit 704 areprovided. Bit 704 is always set; therefore, the output of gate 702 is alogic “1” which directs multiplexer 640 to always produce its outputdata from update register 630. Data from register 630 had previouslybeen loaded from capture register 620 which received its data originallyfrom serial data in 672 (after JTAG port 272 has caused data to beshifted through the cells). In this fashion, serial data provided byJTAG port 272 is eventually output by multiplexer 640 and serves asinput signal 604 to core 502. Input signal 604 may be used to provideeither a control signal or a data input signal for logic analyzer 260.Advantageously, the device may be operated in normal mode and all pinsthat are bonded to I/O cells are still connected to core 502.Furthermore, logic analyzer 260 is allowed to be controlled via JTAGport 272 using the JTAG Sample/Preload instruction that places controlinformation into capture registers 620-624.

Second JTAG Control Embodiment

FIG. 14 illustrates a second embodiment by which JTAG port 272 controlsembedded logic analyzer 260 using a test data register 802. In thisembodiment, a user implemented test data register 802 is used to providecontrol signals to, and to receive data and status form, logic analyzer260. This embodiment is particularly useful if no unbonded I/O cells areavailable. It relies upon extra user-supplied logic in test dataregister 802 instead of using unbonded I/O cells. In addition, thisembodiment provides an extra signal Runtest(user) that allows logicanalyzer 260 to know when the JTAG state machine has entered the Runteststate. Register 802 includes any number of stimulus cells 804 used tocontrol logic analyzer 260 and any number of sense cells 805 used forretrieving data and status from the logic analyzer. Control signals 806include signal TDI(user) which is presented to the first stimulus celland then shifted through all of the cells. Also included are the controlsignals Shift(user), Clock(user), Update(user), and Runtest(user); thesesignals are presented globally to each cell 804 or 805. Signal TDO(user)807 is received from the final sense cell 805 and presented to JTAG port272 to become signal TDO.

In this embodiment, control signals TDI(user), Shift(user), Clock(user),and Update(user) are analogous to signals 672, 680, 682 and 684 from theembodiment shown in FIG. 13 except that these control signals in thissecond embodiment are driven into core 502 instead of being presented toI/O cells. Advantageously, using this uncommon approach of driving JTAGsignals directly into the core, control of an embedded logic analyzer isachieved without using extra pins or I/O cells of the PLD (aside fromthe JTAG port pins). Signal TDO(user) is analogous to signal 674 of theembodiment of FIG. 13 except that signal TDO(user) originates from core502 instead of from an I/O cell 504.

To implement this embodiment, the netlist of the PLD is augmented to adduser-implemented test data register 802. Additionally, each input to andeach output from logic analyzer 260 is routed to an element 804 or 805,respectively. To generate a control signal for delivery to logicanalyzer 260, a private “Usertest” instruction is scanned in, and thenthe control information is scanned in and loaded. Finally, the outputdata from the logic analyzer is scanned out. Further details areprovided below.

FIG. 15 illustrates a stimulus cell 804 that is an element of test dataregister 802. Cell 804 includes capture register 820 and update register822. Scan in signal 824 is received from a previous similar cell or fromJTAG port 272 if this is the first stimulus cell. Scan out signal 826 istransmitted to the next stimulus cell or to the first sense cell 805 ifthis is the last stimulus cell. While a serial shift of informationthrough elements of data register 802 is occurring, information arrivesat cell 804 via scan in 824, is captured by register 820 and is shiftedout via scan out 826. When a parallel load is performed under control ofJTAG port 272, update register 822 transfers the bit stored in register820 to logic analyzer 260. This transferred bit may then be used as acontrol signal for the logic analyzer.

FIG. 16 illustrates a sense cell 805 that is one element of test dataregister 802. Cell 805 includes multiplexer 830 and capture register832. Scan in signal 834 is received from a previous sense cell or fromthe last stimulus cell 804 if this is the first sense cell. Scan outsignal 836 is transmitted to the next sense cell 805 or to JTAG port 272if this is the last sense cell. During serial scanning of informationthrough test data register 802 signal Load(user) is a zero; scanned inbits arrive via scan in 834, are latched using register 832, and areshifted out via scan out 836. During a parallel load operation (or senseoperation), signal Load(user) is a one; data and/or status arrive viamultiplexer 830 and are captured by register 832. Once any number ofbits are captured by cells 805 after a parallel load, the captured bitsare shifted out using the serial shift mode through JTAG port 272 tocomputer system 18 for analysis. In this fashion, sense cells 805 areused to retrieve data and/or status from logic analyzer 260 and topresent the information to a user for analysis.

Further Embodiments

FIGS. 17A, 17B illustrate an alternative embodiment in which any numberof logic analyzers embedded within a device are controlled using a JTAGport. As PLDs become larger and larger, it is possible that eachmegafunction within the device may contain its own embedded logicanalyzer. It would be desirable to be able to control any number ofembedded logic analyzers using a JTAG port using any of the embodimentsdiscussed herein. In one particular implementation, the secondembodiment discussed above in FIGS. 14-16 works well.

Digressing for a moment, it is noted that control of one of two embeddedlogic analyzers may be achieved using a Select signal generated fromJTAG port 272. As is known in the art, private user instructions may beloaded into the JTAG port. In this embodiment, a UserA instruction and aUserB instruction may be provided. Control information destined for afirst logic analyzer is loaded into the UserA instruction; controlinformation destined for a second logic analyzer is loaded into theUserB instruction. When UserA is loaded, signal Select goes high, whenUserB is loaded, Select goes low. Signal Select is then combined withand qualifies the control signals from the JTAG port to be directed toeither a first or a second test data register that control respectively,the first or the second embedded logic analyzer. As is known in the art,a single signal (for example, Select) can enable or disable a controlsignal for a logic analyzer using a simple combination of AND gates,inverters, etc. For example, when Select is a logic “1”, control signalsare directed to the first logic analyzer and outputs are received fromit. The second logic analyzer is selected when Select is a logic “0”.For more than two logic analyzers to be controlled, it is useful to usean embodiment such as will now be described.

FIG. 17A illustrates an embodiment in which logic analyzers 260 a, 260b, 260 c and 260 d present within a single PLD are controlled via a JTAGport of the PLD. Although FIG. 17A provides a simplistic example ofcontrol of only four logic analyzers having minimal inputs and outputs,those of skill in the art upon a reading of this disclosure willappreciate how to implement control of any number of logic analyzers,and of logic analyzers having more complex inputs and outputs.

Each logic analyzer 260 a-260 d is controlled by a respective test dataregister 860-866. For example, logic analyzer 260 a is controlled bytest data register 860. Elements 860 a and 860 b of register 860 providecontrol inputs to logic analyzer 260 a, and elements 860 c and 860 d ofregister 860 receive output data from logic analyzer to 260 a. The otherlogic analyzers are controlled in a similar manner.

In this embodiment, two private user instructions within the JTAG portare used to control any number of logic analyzers. The UserA instructioncontains an address, suitable for selecting which logic analyzer tocontrol and to receive data from at a particular point in time. Thesecond private instruction called UserB provides the actual controlinformation and receives data from the logic analyzer that is selectedusing the UserA instruction. The Select signal is also used in thisembodiment, and is active depending upon whether information in theUserA or the UserB instruction is being accessed.

Test data register 870 contains two elements A1 and A0 through which aUserA instruction is shifted in and out. Not shown is a signalClock(UserA) that is provided to each element. Signal TDO(UserA) 892returns to JTAG port 272. In this fashion, a UserA instruction providesinput to a decoder 872 and to a multiplexer 874 through register 870.Decoder 872 decodes the two bits of register 870 to provide four outputsD3-D0 that are used to control AND gates 882-888. The two bits ofregister 870 also input to multiplexer 874 to select one of the fourlogic analyzers for output. In this simplistic example, each logicanalyzer has only two inputs and two outputs, and register 870 is onlytwo bits wide. It will be appreciated that each of these registers couldbe of any size and that more logic analyzers may also be present.

As mentioned earlier, a second private UserB instruction is used toprovide the actual control information for the logic analyzer selectedby the UserA instruction. Similar to the second embodiment discussedabove, signal TDI(UserB) 876 is provided in a serial fashion to each ofthe test registers 860-866 that control respectively logic analyzers 260a-260 d. Serial information received on signal 876 is shifted throughthe appropriate test data register and eventually is shifted out throughmultiplexer 874 to become signal TDO(UserB) 890 which is returned to theJTAG port. For example, if logic analyzer 260 d were to be selected,control information would be shifted in via signal 876 to element 866 a,shifted then to element 866 b, then shifted to element 866 c and finallyshifted to element 866 d. In a similar fashion, output data receivedfrom logic analyzer 260 d is retrieved using a parallel load intoelements 866 c and 866 d and then shifted out to multiplexer 874.

As discussed earlier, the elements within a particular test dataregister receive numerous control signals such as Shift(user),Clock(user), Update(user), and Runtest(user). These control signals arerouted to the selected logic analyzer using decoder 872 and AND gates882-888. As previously noted, signals Clock(UserB) 880 and Clock(UserA)(not shown) may be generated from signal Clock(user) using AND gates andthe signal Select. When Select is active, Clock(UserA) is clocking andClock(UserB) is not; an inactive Select produces the opposite. In thisfashion, when information from private instruction UserA is beingsupplied, Select is active and enables the appropriate control signals.

In this simplistic example, only the signal Clock(UserB) 880 is shownbeing routed to the selected logic analyzer. Those of skill in the artwill appreciate how the other control signals may also be directed tothe selected logic analyzer in a similar fashion. Output from decoder872 enables only one of four outputs D3-D0 at a time in order to selectone of AND gates 882-888. Thus, signal 880 will only be directed to thetest data register for the selected logic analyzer at a given point intime. For example, should register 870 contain the value “11”, theoutput D3 of decoder 872 would be active and the other output signalswould be low. Thus, only gate 888 would allow signal 880 to pass throughto test data register 860 for controlling logic analyzer 260 a. Theother gates 882-886 would not allow signal 880 to pass through. Othersimilar forms of selection and control may also be used to route thecontrol signals to the selected logic analyzer.

FIG. 17B illustrates one technique by which signals TDO(UserA) 892 andTDO(UserB) 890 from register 870 and multiplexer 874 are returned toJTAG port 272. Signals 890 and 892 are input to multiplexer 894 and oneis selected using signal Select 896. As previously mentioned, Select maybe used to qualify and/or select control signals to a logic analyzer, orfrom a logic analyzer. In this example, if information is being shiftedthrough register 870 Select will be active (which also enablesClock(UserA)) and signal 892 will pass through multiplexer 894 and toport 272. Signal 890 is selected when Select is low. In this fashion,the appropriate output from embodiment 850 is delivered to JTAG port 272and eventually to the single signal TDO of the JTAG port.

Other similar embodiments may also be used to control numerous logicanalyzers. For example, instead of a different test register (such asregisters 860-866) being used for each logic analyzer, there may only beone test data register serving all of the logic analyzers. The selectionlogic used (such as the AND gates and multiplexer of FIG. 17A) wouldthen be placed in-between the logic analyzers and the single test dataregister, rather than outside of the logic analyzers as shown in theembodiment of FIG. 17A.

For example, input control signals (such as Clock(user), Shift(user),etc.) from the JTAG port would connect directly to the elements of thesingle test data register. Data from the UserB instruction would beshifted into this test data register to provide control for one of thelogic analyzers. Each input element of the test data register would berouted to each logic analyzer and be qualified by an AND gate, orsimilar selection circuitry. For example, if three bits of controlinformation are to be supplied from the single test data register tofour different logic analyzers, there would be four AND gates for eachbit of control information (each associated with a logic analyzer) for atotal of twelve AND gates (or similar selection logic). To apply a bitof control information to a selected logic analyzer, selection logicsimilar to register 870 and decoder 872 may be employed. In other words,the private UserA instruction may be used to select which logic analyzerwill be controlled. Decoded information from this UserA instruction maythen be used to select and/or disable the AND gates for each bit ofcontrol information. In this way, a single bit of control information isenabled to reach one selected logic analyzer, but not the others.

In a similar fashion, multiplexers may be employed to select from whichlogic analyzers an output signal will be accepted for input to thesingle test data register. For example, a single multiplexer (or similarselection logic) would be used for each element of the test dataregister that receives output data from the logic analyzer. Routed tothis multiplexer are the corresponding data signals from each of thelogic analyzers. For example, the least significant data bit from eachof the logic analyzers is routed to a single multiplexer that providesoutput to a single element of the test data register. The multiplexer iscontrolled via bits from the UserA test data register in a similarfashion as shown in FIG. 17A. A multiplexer would be supplied for eachoutput element of the test data register, and each controlled by thesame selection logic.

Other embodiments are also possible. The first embodiment presentedabove in FIGS. 11-13 or the second embodiment presented above FIGS.14-16 may be used exclusively to control a logic analyzer or they may becombined to provide control. If a sufficient number of extra unbondedI/O cells are available, it may be desirable to use the first embodimentexclusively. This is especially true if it would be difficult to insertextra logic into the device. If insufficient I/O cells are available, itmay be desirable to use the second embodiment, as long as the additionof the extra logic required by test data register 802 is not a problem.Using exclusively the first embodiment, a Clock signal can be providedto the embedded logic analyzer by using input signal 604. To providethis Clock signal, alternating 1's and 0's are shifted into oneparticular I/O cell and then loaded one at a time to provide analternating pulse. Each new bit, though, must be scanned in through anentire set of registers before the bit can be provided as a Clocksignal. For this reason, this technique of providing a Clock signal tothe embedded logic analyzer using the first embodiment is not extremelyefficient.

In a more optimal solution, a combination of the first and secondembodiments are used. In this solution, the extra signal Runtest(user)available in the second embodiment is used to provide a Clock signal tothe embedded logic analyzer. Upon transition of this Clock signal, thelogic analyzer is instructed to look at the control signals arrivingfrom input signals 604 of the various I/O cells 504 that have beenimplemented using the first embodiment. The signal Runtest(user) can bemade to provide clock pulses simply by causing JTAG port 272 to enterthis state and then back out in an alternating fashion. Using thistechnique, more efficient control is provided yet extra unbonded I/Ocells may still be used to provide the actual control information to thelogic analyzer.

Computer System Embodiment

FIG. 18 illustrates a computer system 900 in accordance with anembodiment of the present invention. Computer system 900 includes anynumber of processors 902 (also referred to as central processing units,or CPUs) that are coupled to storage devices including primary storage906 (such as random access memory, or RAM) and primary storage 904 (suchas a read only memory, or ROM). As is well known in the art, primarystorage 904 acts to transfer data and instructions uni-directionally tothe CPU and primary storage 906 is used typically to transfer data andinstructions in a bi-directional manner. Both of these primary storagedevices may include any suitable of the computer-readable mediadescribed below. A mass storage device 908 is also coupledbi-directionally to CPU 902 and provides additional data storagecapacity and may also include any of the computer-readable mediadescribed below. Mass storage device 908 may be used to store programs,data and the like and is typically a secondary storage medium (such as ahard disk) that is slower than primary storage. It will be appreciatedthat the information retained within mass storage device 908, may, inappropriate cases, be incorporated in standard fashion as part ofprimary storage 906 as virtual memory. A specific mass storage devicesuch as a CD-ROM 914 passes data uni-directionally to the CPU.

CPU 902 is also coupled to an interface 910 that includes one or moreinput/output devices such as such as video monitors, track balls, mice,keyboards, microphones, touch-sensitive displays, transducer cardreaders, magnetic or paper tape readers, tablets, styluses, voice orhandwriting recognizers, biometrics readers, or other computers. CPU 902optionally may be coupled to another computer or telecommunicationsnetwork using a network connection as shown generally at 912. With sucha network connection, it is contemplated that the CPU might receiveinformation from the network, or might output information to the networkin the course of performing the above-described method steps.

In addition, embodiments of the present invention further relate tocomputer storage products with a computer readable medium that haveprogram code thereon for performing various computer-implementedoperations. The media and program code may be those specially designedand constructed for the purposes of the present invention, or they maybe of the kind well known and available to those having skill in thecomputer software arts. Examples of computer-readable media include, butare not limited to: magnetic media such as hard disks, floppy disks, andmagnetic tape; optical media such as CD-ROM disks; magneto-optical mediasuch as floptical disks; and hardware devices that are speciallyconfigured to store and execute program code, such as ROM and RAMdevices. Examples of program code include both machine code, such asproduced by a compiler, and files containing higher level code that maybe executed by the computer using an interpreter.

Although the foregoing invention has been described in some detail forpurposes of clarity of understanding, it will be apparent that certainchanges and modifications may be practiced within the scope of theappended claims. For instance, a logic analyzer may be embedded in anysuitable device or circuit board that lends itself to being programmed.Also, the present invention is applicable to any type of EDA tool thatis able to compile a user design. Although only one example ofcompilation of a logic analyzer is presented, variations on this compiletechnique may occur depending upon the device for which the design isbeing compiled and still take advantage of the present invention.Furthermore, the specific logic analyzer circuit shown is exemplary;other circuits may also be used to implement a logic analyzer. Aninterface to the logic analyzer from a computer may use any number ofpins and any type of protocol such as serial, parallel, etc. A JTAG portmay control one or more embedded logic analyzers using either the firstor second control embodiments described, or a combination of the two.Therefore, the described embodiments should be taken as illustrative andnot restrictive, and the invention should not be limited to the detailsgiven herein but should be defined by the following claims and theirfull scope of equivalents.

We claim:
 1. A computer-readable medium comprising computer code forreceiving sample data from a logic analyzer embedded within aprogrammable logic device (PLD), said computer code of saidcomputer-readable medium effecting the following: automaticallyembedding a logic analyzer within a programmable logic device (PLD);specifying a breakpoint indicative of the state of at least one signalwithin said PLD; indicating to said logic analyzer to continuously storeinternal signals of said PLD in a memory of said logic analyzer suchthat said internal signals are stored before the occurrence of saidbreakpoint; receiving said stored internal signals from said logicanalyzer, said stored signals representing at least signals storedbefore said breakpoint, whereby said stored internal signals may beviewed on a user computer.
 2. A computer-readable medium as recited inclaim 1 further comprising computer code for effecting the following:determining total number of samples to be captured and number of samplesto be captured after said breakpoint; and communicating said totalnumber of samples to be captured and said number of samples to becaptured after said breakpoint to said logic analyzer, whereby once saidbreakpoint occurs said logic analyzer continues to capture samples equalto said number of samples to be captured after said breakpoint.
 3. Acomputer-readable medium as recited in claim 1 wherein communication toand from said logic analyzer occurs through a JTAG port of said PLD. 4.A computer-readable medium comprising computer code for retrieving datastored in a logic analyzer embedded in a programmable logic device(PLD), said computer code of said computer-readable medium effecting thefollowing: compiling an electronic design and automatically inserting alogic analyzer to produce a complete design file; programming a PLD withsaid complete design file, said logic analyzer being embedded in saidPLD; instructing said logic analyzer in said PLD to run such that saidlogic analyzer begins to continuously monitor internal nodes of said PLDand to continuously store internal signals from said internal nodes in amemory of said logic analyzer at least up to a breakpoint; issuing adump data request to said logic analyzer in said PLD; and receiving saidstored internal signals from said memory of said logic analyzer, saidstored signals representing at least signals monitored before saidbreakpoint, whereby said stored internal signals may be viewed on a usercomputer.
 5. A computer-readable medium as recited in claim 4 furthercomprising computer code for effecting the following: determining totalnumber of samples to be captured and number of samples to be capturedafter said breakpoint; and communicating said total number of samples tobe captured and said number of samples to be captured after saidbreakpoint to said logic analyzer, whereby once said breakpoint occurssaid logic analyzer continues to capture samples equal to said number ofsamples to be captured after said breakpoint.
 6. A computer-readablemedium as recited in claim 4 wherein communication to and from saidlogic analyzer occurs through a JTAG port of said PLD.
 7. A method forreceiving sample data from a logic analyzer embedded within aprogrammable logic device (PLD), said method comprising: automaticallyembedding a logic analyzer within a programmable logic device (PLD);specifying a breakpoint indicative of the state of at least one signalwithin said PLD; indicating to said logic analyzer to continuously storeinternal signals of said PLD in a memory of said logic analyzer suchthat said internal signals are stored before the occurrence of saidbreakpoint; receiving said stored internal signals from said logicanalyzer, said stored signals representing at least signals storedbefore said breakpoint, whereby said stored internal signals may beviewed on a user computer.
 8. A method as recited in claim 7 furthercomprising: determining total number of samples to be captured andnumber of samples to be captured after said breakpoint; andcommunicating said total number of samples to be captured and saidnumber of samples to be captured after said breakpoint to said logicanalyzer, whereby once said breakpoint occurs said logic analyzercontinues to capture samples equal to said number of samples to becaptured after said breakpoint.
 9. A method as recited in claim 7wherein said steps of specifying, indicating and receiving make use aJTAG port of said PLD.
 10. A method for retrieving data stored in alogic analyzer embedded in a programmable logic device (PLD), saidmethod comprising: compiling an electronic design and automaticallyinserting a logic analyzer to produce a complete design file;programming a PLD with said complete design file, said logic analyzerbeing embedded in said PLD; instructing said logic analyzer in said PLDto run such that said logic analyzer begins to continuously monitorinternal nodes of said PLD and to continuously store internal signalsfrom said internal nodes in a memory of said logic analyzer at least upto a breakpoint; issuing a dump data request to said logic analyzer insaid PLD; and receiving said stored internal signals from said memory ofsaid logic analyzer, said stored signals representing at least signalsmonitored before said breakpoint, whereby said stored internal signalsmay be viewed on a user computer.
 11. A method as recited in claim 10further comprising: determining total number of samples to be capturedand number of samples to be captured after said breakpoint; andcommunicating said total number of samples to be captured and saidnumber of samples to be captured after said breakpoint to said logicanalyzer, whereby once said breakpoint occurs said logic analyzercontinues to capture samples equal to said number of samples to becaptured after said breakpoint.
 12. A method as recited in claim 10where in said steps of instructing , issuing, receiving andcommunicating make use a JTAG port of said PLD.
 13. A method forcapturing sample data by a logic analyzer embedded within a programmablelogic device (PLD), said method comprising: receiving a breakpointindicative of a state of at least one signal within said PLD; receivingPLD signal information indicating specified signals to monitor withinsaid PLD; continuously storing said specified signals in a memory ofsaid logic analyzer such that said internal signals are stored beforethe occurrence of said breakpoint; determining the occurrence of saidbreakpoint; wherein when it is determined that said breakpoint hasoccurred, arranging said memory of said logic analyzer such that aportion of said internal signals stored before said breakpoint areavailable for later analysis.
 14. A method as recited in claim 13further comprising: receiving a value indicating the number of samplesto be captured after said breakpoint; and continuing to store saidspecified signals in said memory of said logic analyzer after theoccurrence of said breakpoint, whereby once said breakpoint occurs saidlogic analyzer continues to capture signals equal to said number ofsamples to be captured after said breakpoint.
 15. A method as recited inclaim 13 wherein said steps of continuously storing and continuing tostore both store said specified signals in a ring buffer that overwritesearlier stored signals when full, whereby signals stored before saidbreakpoint are made available for later analysis.
 16. A method asrecited in claim 13 wherein said step of receiving a breakpoint receivessaid breakpoint from a user computer through a JTAG port of said PLD.17. A programmable logic device (PLD) comprising: PLD circuitryrepresenting one iteration of an electronic design in a design processto create a final PLD; logic analyzer circuitry integrated within saidPLD circuitry such that a portion of said PLD circuitry is connected tosaid logic analyzer circuitry; logic means within said logic analyzercircuitry for initiating the capture of signals from said PLD circuitrybefore a breakpoint occurs; and sample memory circuitry within saidlogic analyzer circuitry arranged to capture said signals before saidbreakpoint occurs, whereby said sample memory circuitry is available topresent said captured signals for analysis after said capture.
 18. Aprogrammable logic device (PLD) as recited in claim 17 furthercomprising: second logic means within said logic analyzer circuitry forcontinuing the capture of signals from said PLD circuitry after saidbreakpoint occurs, said sample memory circuitry being further arrangedto capture said signals after said breakpoint occurs, whereby saidsample memory circuitry is available to present said captured signalsfor analysis after said capture.
 19. A programmable logic device asrecited in claim 17 wherein said sample memory circuitry includes a ringbuffer that overwrites earlier stored signals when full, whereby signalsstored before said breakpoint are made available for later analysis. 20.A programmable logic device as recited in claim 17 further comprising: aJTAG port in communication with said logic analyzer, said JTAG port usedto receive said breakpoint and an indication of said signals from a usercomputer, said JTAG port further used to present said captured signalsfor analysis to said user computer.